<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>shopping</title>
</head>
<body>
    <script>
        let shoe={
            price:189,
        }
        let book={
            price:38.9,
        }
        let cloth={
            price:99,
        }
        const add=[
            {
                name:'shoe',
                price:189,
            },
            {
                name:'book',
                price:38.9,
            },{
                namec:'cloth',
                price:99,
            }
        ];
        function addto(goods){     
            let sum=0;
            for(let i=0;i<goods.length;i++){
                sum=sum+goods[i].price;
            }
            return sum;
        }       
        console.log(addto(add));
    </script>
</body>
</html>